package com.example.demo;

import cn.hutool.core.io.FileUtil;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.BufferedReader;
import java.nio.charset.Charset;

@RestController
@SpringBootApplication
public class DemoApplication implements CommandLineRunner {

    public static void main(String[] args) {
        SpringApplication.run(DemoApplication.class, args);
    }

    @GetMapping("test")
    public String getTest() {
        return "test";
    }

    @Override
    public void run(String... args) throws Exception {
        BufferedReader reader = FileUtil.getReader("C:\\Users\\lizhancai\\workspace-idea\\boot\\demo\\src\\main\\resources\\data.text", Charset.defaultCharset());
        String s = reader.readLine();
    }
}
